﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using UnityEngine.Events;

public enum UIElementType{
    Button
}
public abstract class BaseUIElement : MonoBehaviour
{

    public string uiElementName;
    //保存调用方法时传递的参数值
    protected object[] parameters = new object[] { };
    //设置调用方法时传递的参数值
    public void SetParameters(object[] parameters) {
        this.parameters = parameters;
    }

    protected abstract void SetMethod(BasePanel panel);

    //绑定方法并且设置uiElementName
    public void SetMethodAndName(BasePanel panel, string name) {
        this.uiElementName = name;
        gameObject.name = name;
        SetMethod(panel);
    }

    //绑定方法
    public abstract void BindMethod(MethodInfo Method, BasePanel panel);
}
